package com.hkts.beltweigher.salve.service.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hkts.beltweigher.salve.entity.WestBeltscalesInstantaneousdata;
import com.hkts.beltweigher.salve.mapper.WestBeltscalesInstantaneousdataMapper;
import com.hkts.beltweigher.salve.service.IWestBeltscalesInstantaneousdataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hml
 * @since 2024-07-04
 */
@Service
@Transactional
public class WestBeltscalesInstantaneousdataServiceImpl extends ServiceImpl<WestBeltscalesInstantaneousdataMapper, WestBeltscalesInstantaneousdata> implements IWestBeltscalesInstantaneousdataService {


    @Autowired
    private WestBeltscalesInstantaneousdataMapper westBeltscalesInstantaneousdataMapper;

    @Override
    public IPage<WestBeltscalesInstantaneousdata> selectPage(Page<WestBeltscalesInstantaneousdata> page, WestBeltscalesInstantaneousdata westBeltscalesInstantaneousdata) {
        QueryWrapper<WestBeltscalesInstantaneousdata> query = Wrappers.query();
        return westBeltscalesInstantaneousdataMapper.selectPage(page, query);
    }


    @Override
    public List<WestBeltscalesInstantaneousdata> selectList(WestBeltscalesInstantaneousdata westBeltscalesInstantaneousdata) {
        QueryWrapper<WestBeltscalesInstantaneousdata> query = Wrappers.query();
        return westBeltscalesInstantaneousdataMapper.selectList(query);
    }

    @Override
    public WestBeltscalesInstantaneousdata selectByLastData() {
        QueryWrapper<WestBeltscalesInstantaneousdata> query = Wrappers.query();
        query.orderByDesc();
        return westBeltscalesInstantaneousdataMapper.selectOne(query);
    }

}
